<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改khgl')" />
            <th:block th:include="include :: datetimepicker-css" />
            <th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<style>
    .jltable{
        margin: auto;
    }
    .jltable th,td{
        min-height: 40px;
        min-width: 50px;
        border: 1px solid #eee;
        padding: 10px;
    }
</style>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-khgl-edit" th:object="${lwpqKhgl}">
        <input name="id" th:field="*{id}" type="hidden">
        <h4 class="form-header h4" style="margin-top: 20px">客户信息</h4>
        <table class="jltable">
            <tbody>
                <tr>
                    <td><label class="control-label is-required">单位名称：</label></td>
                    <td> <input name="dwmc" th:field="*{dwmc}" class="form-control" type="text" required></td>
                    <td></td>
                    <td><label class="control-label">负责人：</label></td>
                    <td> <input name="fzr" th:field="*{fzr}" class="form-control" type="text"></td>
                </tr>

                <tr>
                    <td><label class="control-label">纳税编号：</label></td>
                    <td> <input name="nsbh" th:field="*{nsbh}" class="form-control" type="text"></td>
                    <td></td>
                    <td><label class="control-label">负责人电话：</label></td>
                    <td> <input name="fzrdh" th:field="*{fzrdh}" class="form-control" type="text"></td>
                </tr>
            <tr>
                <td><label class="control-label">单位性质：</label></td>
                <td>
                    <select name="dwxz" class="form-control" th:with="type=${@dict.getType('khdwxz')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{dwxz}"></option>
                    </select>
                </td>
                <td></td>
                <td><label class="control-label">业务类型：</label></td>
                <td>
                    <select name="ywlx" class="form-control" th:with="type=${@dict.getType('khywlx')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{ywlx}"></option>
                    </select>
                </td>
            </tr>
            </tbody>
        </table>

        <h4 class="form-header h4" style="margin-top: 20px">详细信息</h4>
        <table class="jltable">
            <tbody>
            <tr>
                <td><label class="control-label">客户状态：</label></td>
                <td>
                    <select name="khzt" class="form-control" th:with="type=${@dict.getType('khkhzt')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{khzt}"></option>
                    </select>
                </td>
                <td></td>
                <td><label class="control-label">客户来源：</label></td>
                <td>
                    <select name="khly" class="form-control" th:with="type=${@dict.getType('khkhly')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{khly}"></option>
                    </select>
                </td>
            </tr>

                <tr>
                    <td><label class="control-label">派遣原因：</label></td>
                    <td> <input name="pqyy" th:field="*{pqyy}" class="form-control" type="text"></td>
                    <td></td>
                    <td><label class="control-label">跟进时间：</label></td>
                    <td>
                        <div class="input-group date">
                            <input name="gjsj" th:value="${#dates.format(lwpqKhgl.gjsj, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>

        <h4 class="form-header h4" style="margin-top: 20px">业务信息</h4>
        <table class="jltable">
            <tbody>
                <tr>
                    <td><label class="control-label">需求类型：</label></td>
                    <td> <input name="xqlx" th:field="*{xqlx}" class="form-control" type="text"></td>
                    <td><label class="control-label">服务时间：</label></td>
                    <td> <input name="fwsj" th:field="*{fwsj}" class="form-control" type="text"></td>
                </tr>

                <tr>
                    <td><label class="control-label">需求人数：</label></td>
                    <td> <input name="xqrs" th:field="*{xqrs}" class="form-control" type="text"></td>
                    <td><label class="control-label">到岗时间：</label></td>
                    <td>
                        <div class="input-group date">
                            <input name="dgsj" th:value="${#dates.format(lwpqKhgl.dgsj, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        </div>
                    </td>
                </tr>

                <tr>
                    <td><label class="control-label">年龄要求：</label></td>
                    <td> <input name="nlyq" th:field="*{nlyq}" class="form-control" type="text"></td>
                    <td><label class="control-label">合同数：</label></td>
                    <td> <input name="hts" th:field="*{hts}" class="form-control" type="text"></td>
                </tr>

                <tr>
                    <td><label class="control-label">用工单位编号：</label></td>
                    <td> <input name="ygdwbh" th:field="*{ygdwbh}" class="form-control" type="text"></td>
                    <td><label class="control-label">业务员：</label></td>
                    <td> <input name="ywy" th:field="*{ywy}" class="form-control" type="text"></td>
                </tr>
            <tr>
                <td><label class="control-label">说明：</label></td>
                <td colspan="3"><textarea name="sm" class="form-control">[[*{sm}]]</textarea></td>
            </tr>
                <tr>
                    <td>
                    <label class="control-label">相关文件：</label></td>
                    <td colspan="3">
                        <input type="hidden" name="xgwj">
                        <div class="file-loading">
                            <input class="form-control file-upload" id="xgwj" name="file" type="file">
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
    </form>
</div>
<th:block th:include="include :: footer" />
        <th:block th:include="include :: datetimepicker-js" />
        <th:block th:include="include :: bootstrap-fileinput-js"/>
<script th:inline="javascript">
    var prefix = ctx + "lwpq/khgl";
    $("#form-khgl-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-khgl-edit').serialize());
        }
    }

            $("input[name='gjsj']").datetimepicker({
                format: "yyyy-mm-dd",
                minView: "month",
                autoclose: true
            });

            $("input[name='dgsj']").datetimepicker({
                format: "yyyy-mm-dd",
                minView: "month",
                autoclose: true
            });

            $(".file-upload").each(function (i) {
                var val = $("input[name='" + this.id + "']").val()
                $(this).fileinput({
                    'uploadUrl': ctx + 'common/upload',
                    initialPreviewAsData: true,
                    initialPreview: [val],
                    maxFileCount: 1,
                    autoReplace: true
                }).on('fileuploaded', function (event, data, previewId, index) {
                    $("input[name='" + event.currentTarget.id + "']").val(data.response.url)
                }).on('fileremoved', function (event, id, index) {
                    $("input[name='" + event.currentTarget.id + "']").val('')
                })
                $(this).fileinput('_initFileActions');
            });
</script>
</body>
</html>